<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateCouponExtension extends Migrator
{
    public function up()
    {
        // create the table
        $table = $this->table('coupon_extension', ['id' => 'id', 'comment' => '品牌渠道推广', 'engine' => 'InnoDB', '']);
        $table ->addColumn('obj_id', 'integer', ['limit' => 15, 'default' => 0, 'comment' => '用户名'])
            ->addColumn('channel_name', 'string', ['limit' => 60, 'default' => '', 'comment' => '渠道名'])
            ->addColumn('type', 'integer', ['limit' => 15, 'default' => 1, 'comment' => '类型'])
            ->addColumn('status', 'integer', ['limit' => 15, 'default' => 1, 'comment' => '状态1正常2停止'])
            ->create();
    }

    public function down()
    {
        $this->table('coupon_extension')->drop();
    }
}
